//
//  ViewController.m
//  Thread
//
//  Created by cocoazxj@163.com on 15/4/23.
//  Copyright (c) 2015年 handcool. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (nonatomic, assign) int ticket;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSLog(@"-mainThread---%@-",[NSThread currentThread]);
    self.ticket = 100;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSThread *thread1 = [[NSThread alloc] initWithTarget:self selector:@selector(test) object:nil];
    thread1.name = @"test1";
    [thread1 start];
    
    NSThread *thread2 = [[NSThread alloc] initWithTarget:self selector:@selector(test) object:nil];
    thread2.name = @"test2";
    [thread2 start];
    
    NSThread *thread3 = [[NSThread alloc] initWithTarget:self selector:@selector(test) object:nil];
    thread3.name = @"test3";
    [thread3 start];
}

- (void)test
{
    NSLog(@"-thread--------%@-",[NSThread currentThread]);
}
@end
